/**
 * @author wn
 * @date 2024/01/12 10:53:37
 * @description: 订单支付 API
 */

import { request } from '@/utils/request'

enum Url {
	Pay = '/pay/wxPay/miniPay',
	PayMock = '/pay/mock',
}

/**
 * 获取微信支付参数
 * @param data -- orderId 订单id
 */
export const getWxPayApi = (data: { orderId: string }) => {
	return request<WechatMiniprogram.RequestPaymentOption>({
		method: 'GET',
		url: Url.Pay,
		data,
	})
}

/**
 * 模拟支付
 * @param data -- orderId 订单id
 */
export const getPayMockApi = (data: { orderId: string }) => {
	return request({
		method: 'GET',
		url: Url.PayMock,
		data,
	})
}
